# Contributor: David Demelier <markand@malikania.fr>
# Maintainer: David Demelier <markand@malikania.fr>
pkgname=tagutil
pkgver=3.1
pkgrel=2
pkgdesc="scriptable music files tags tool and editor"
url="https://github.com/kAworu/tagutil"
arch="all"
license="BSD-2-Clause"
makedepends="cmake samurai flac-dev jansson-dev libvorbis-dev taglib-dev yaml-dev zlib-dev"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/kAworu/tagutil/archive/v3.1.tar.gz
	patch-musl.patch
	cmake-flags.patch
	"
options="!check" # No tests

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		$CMAKE_CROSSOPTS src
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
a5b2140250f21eddd0154231608546b78c5646bb4bcb6ed7b11a3cbade2435c322d83c19a2a2e6852cdacca19a2b1cd6e33c0b71147d6873679d2b41db5a06d9  tagutil-3.1.tar.gz
2915411e1dc38126879c19d69caf8923fbcb95c72b3371661f50078b2722369ebb88f6dd3de9ba78f974a1eb07b743b1d69e40ee678f2a6f1634d8c972a18ef9  patch-musl.patch
c723afa8f22fa45ff49697a21065fe1c61985073aa8335f04d3770a93447404cb5adbd11f10f4f786fa2b825423646cda49ec3cc25c73362f9ce4061a95ba2fb  cmake-flags.patch
"
